public class Apple {

	private double weight;
	private boolean isRotten;
	
	public Apple(double weight, boolean isRotten) {
		this.weight = weight;
		this.isRotten = isRotten;
	}
	public Apple() {
		this(0.0,true);
	}
	public Apple(double weight) {
		this(weight, false);
	}
	
	/** Returns the weight of the apple, in pounds */
	public double getWeight() {
		return weight;
	}
	/** Returns true if the apple is rotten
	 * and returns false otherwise
	 */
	public boolean isRotten() {
		return isRotten;
	}
	
	public String toString() {
		return isRotten? "ROTTEN" : " "+weight+" ";
	}

}
